<template>
    <button class="zgn-button" :class="classes">
        <slot />
    </button>
</template>

<script lang="ts">
import { computed } from 'vue';
export default {
    props:{
        theme:{
            type:String,
            default:'button'
        },
        size:{
            type:String,
            default:'normal'
        },
        purpose:{
            type:String,
            default:'none'
        }
    } ,
    setup(props){
        const {theme,size,purpose} =props
        const classes = computed(()=>{
            return {
                [`zgn-theme-${theme}`]:theme,
                [`zgn-size-${size}`]:size,
                [`zgn-purpose-${purpose}`]:purpose,
            }
        })
        return {classes}
    } 
}
</script>

<style lang="scss">
$h:32px;
$border-color:#d9d9d9;
$color:#333;
$blue:#40a9ff;
$radius:10px;
.zgn-button{
    box-sizing: border-box;
    height:$h;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    white-space: nowrap;
    background: white;
    color: $color;
    border: none;
    padding: 0 12px;
    border:1px solid $border-color;
    border-radius: 10px;
    box-shadow: 0 1px 0 fade-out($color: #000000, $amount: 0.95)
    &+&{
        margin-left:8px;
    }
    &:hover,&:focus{
        box-shadow: 1px 1px 1px 1px gray;
    }
    &:focus{
        outline:none;
    }
    &::-moz-focus-inner{
        border:0px;
    }
}

 .zgn-theme-button{
    padding: 5px;
    padding-left: 10px;
    padding-right: 10px;
    font-size: 16px;
    border: none;
    margin-left: 10px;
    border-radius: 10px;
    box-shadow: 1px 1px 2px 2px rgb(201, 199, 199);
    background-color: rgba(235, 231, 231, 0.5);
    color: black;
    &:hover,&:focus{
        box-shadow: 1px 1px 2px 2px gray;
    }
    &.zgn-purpose-no{
        background-color: brown;
        color:rgb(221, 216, 216);
    }
    &.zgn-purpose-yes{
        background: rgb(59, 85, 71);
        color:rgb(221, 216, 216);
    }
}

.zgn-theme-link{
    color: #40a9ff;
    border:none;
    padding: 5px;
    padding-left: 10px;
    padding-right: 10px;
    &:hover,&:focus{
        box-shadow: 0px 1px 1px 1px rgb(173, 170, 170);
    }
    &.zgn-purpose-no{
        background-color: white;
        color: brown;
        text-decoration:line-through;
    }
}

.zgn-theme-text{
    border:none;
    padding: 5px;
    padding-left: 15px;
    padding-right: 15px;
    &:hover,&:focus{
        box-shadow: 0px 0px 2px 0px rgb(161, 157, 157);
    }
    &.zgn-purpose-no{
        background-color: white;
        color: brown;
    }
}

.zgn-size-big{
    font-size: 18px;
    line-height: 1em;
    height: 40px;
    padding-left: 20px;
    padding-right: 20px;   
}

.zgn-size-small{
    font-size: 12px;
    height: 25px;
} 


</style>